import request, {ApiResponse} from "@/plugins/axios";


export const getListTemplateByPage = (params) => {
    return request.get<any, ApiResponse<any>>(`/template/list/page`, {params});
};

export const getByTemplateId = (id) => {
    return request.get<any, ApiResponse<any>>(`/template/get/${id}`);
};

export const getListTemplate = (params) => {
    return request.get<any, ApiResponse<any>>(`/template/list`, {params});
};

export const addTemplate = (data) => {
    return request.post<any, ApiResponse<any>>(`/template/add`, data);
};

export const updateTemplate = (data) => {
    return request.post<any, ApiResponse<any>>(`/template/update`, data);
};

export const deleteTemplate = (data) => {
    return request.post<any, ApiResponse<any>>(`/template/delete`, data);
};

export const backupTemplate = (data) => {
    return request.post<any, ApiResponse<any>>(`/template/backup`, data);
};

